#include "stdafx.h"
#include "xEvent.h"

xEvent::xEvent()
{
	m_fnEvent = NULL;
	m_pFrame = NULL;
}

xEvent::~xEvent()
{
}

void xEvent::FireEvent(xControl *pSender, DWORD nEvent, WPARAM wParam, LPARAM lParam)
{
	if(m_pFrame != NULL && m_fnEvent != NULL)
	{
		(m_pFrame->*m_fnEvent)(pSender, nEvent, wParam, lParam);
	}
}

void xEvent::Delegate(xFrame *pFrame, FnEvent fnEvent)
{
	m_pFrame = pFrame;
	m_fnEvent = fnEvent;
}